import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('@/views/layout/Layout.vue'),
    children: [
      {
        path: '',
        name: 'Home',
        component: () => import('@/views/home/Home.vue')
      },
      {
        path: 'api-manage',
        name: 'ApiManage',
        component: () => import('@/views/api-manage/ApiManage.vue')
      },
      {
        path: 'data-source',
        name: 'DataSource',
        component: () => import('@/views/data-source/DataSource.vue')
      },
      {
        path: 'permission',
        name: 'Permission',
        component: () => import('@/views/permission/Permission.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 